﻿namespace Microsoft.SharePoint.Client
{
    using System;
    using System.ComponentModel;

    [ScriptType("SP.FieldRatingScale", ServerTypeId="{66d84fdd-bdb2-4e21-bed0-67f3eab33de4}")]
    public class FieldRatingScale : FieldMultiChoice
    {
        [EditorBrowsable(EditorBrowsableState.Never)]
        public FieldRatingScale(ClientRuntimeContext Context, ObjectPath ObjectPath) : base(Context, ObjectPath)
        {
        }

        protected override bool InitOnePropertyFromJson(string peekedName, JsonReader reader)
        {
            bool flag = base.InitOnePropertyFromJson(peekedName, reader);
            if (!flag)
            {
                switch (peekedName)
                {
                    case "GridStartNumber":
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["GridStartNumber"] = reader.ReadInt32();
                        return flag;

                    case "GridEndNumber":
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["GridEndNumber"] = reader.ReadInt32();
                        return flag;

                    case "RangeCount":
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["RangeCount"] = reader.ReadInt32();
                        return flag;

                    case "GridTextRangeLow":
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["GridTextRangeLow"] = reader.ReadString();
                        return flag;

                    case "GridTextRangeAverage":
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["GridTextRangeAverage"] = reader.ReadString();
                        return flag;

                    case "GridTextRangeHigh":
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["GridTextRangeHigh"] = reader.ReadString();
                        return flag;

                    case "GridNAOptionText":
                        flag = true;
                        reader.ReadName();
                        base.ObjectData.Properties["GridNAOptionText"] = reader.ReadString();
                        return flag;
                }
            }
            return flag;
        }

        [Remote]
        public int GridEndNumber
        {
            get
            {
                base.CheckUninitializedProperty("GridEndNumber");
                return (int) base.ObjectData.Properties["GridEndNumber"];
            }
            set
            {
                base.ObjectData.Properties["GridEndNumber"] = value;
                if (base.Context != null)
                {
                    base.Context.AddQuery(new ClientActionSetProperty(this, "GridEndNumber", value));
                }
            }
        }

        [Remote]
        public string GridNAOptionText
        {
            get
            {
                base.CheckUninitializedProperty("GridNAOptionText");
                return (string) base.ObjectData.Properties["GridNAOptionText"];
            }
            set
            {
                base.ObjectData.Properties["GridNAOptionText"] = value;
                if (base.Context != null)
                {
                    base.Context.AddQuery(new ClientActionSetProperty(this, "GridNAOptionText", value));
                }
            }
        }

        [Remote]
        public int GridStartNumber
        {
            get
            {
                base.CheckUninitializedProperty("GridStartNumber");
                return (int) base.ObjectData.Properties["GridStartNumber"];
            }
            set
            {
                base.ObjectData.Properties["GridStartNumber"] = value;
                if (base.Context != null)
                {
                    base.Context.AddQuery(new ClientActionSetProperty(this, "GridStartNumber", value));
                }
            }
        }

        [Remote]
        public string GridTextRangeAverage
        {
            get
            {
                base.CheckUninitializedProperty("GridTextRangeAverage");
                return (string) base.ObjectData.Properties["GridTextRangeAverage"];
            }
            set
            {
                base.ObjectData.Properties["GridTextRangeAverage"] = value;
                if (base.Context != null)
                {
                    base.Context.AddQuery(new ClientActionSetProperty(this, "GridTextRangeAverage", value));
                }
            }
        }

        [Remote]
        public string GridTextRangeHigh
        {
            get
            {
                base.CheckUninitializedProperty("GridTextRangeHigh");
                return (string) base.ObjectData.Properties["GridTextRangeHigh"];
            }
            set
            {
                base.ObjectData.Properties["GridTextRangeHigh"] = value;
                if (base.Context != null)
                {
                    base.Context.AddQuery(new ClientActionSetProperty(this, "GridTextRangeHigh", value));
                }
            }
        }

        [Remote]
        public string GridTextRangeLow
        {
            get
            {
                base.CheckUninitializedProperty("GridTextRangeLow");
                return (string) base.ObjectData.Properties["GridTextRangeLow"];
            }
            set
            {
                base.ObjectData.Properties["GridTextRangeLow"] = value;
                if (base.Context != null)
                {
                    base.Context.AddQuery(new ClientActionSetProperty(this, "GridTextRangeLow", value));
                }
            }
        }

        [Remote]
        public int RangeCount
        {
            get
            {
                base.CheckUninitializedProperty("RangeCount");
                return (int) base.ObjectData.Properties["RangeCount"];
            }
        }
    }
}

